<template>
  <div>
    <h1>我是孙子组件</h1>
    <h2>座驾:{{car.name}}-价格:{{car.price}}</h2>
  </div>
</template>

<script>
import {inject} from "vue";

export default {
  name: "my-grandson",
  setup() {
    let car = inject('car');
    return {
      car
    }
  }
}
</script>

<style scoped>
  div{
    background-color: orange;
  }
</style>